import React, { Component } from 'react';
import styles from './item.module.css'
import {Link} from 'react-router-dom'
class Index extends Component {
    render() {
        const MusicItem=this.props.data.map(item=>{
            return (
                <Link to={`/MusicDetail?id=${item.id}`}>
                <div >
                <img className={styles.img} src={item.coverImgUrl} alt="" />
                <div className={styles.title}>{item.name}</div>
                </div>
                </Link>
            )
        })
        return (
            <div className={styles.content}>
                {MusicItem}
            </div>
        );
    }
    
}

export default Index;

